package web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import beans.Story;
import service.ShowStoryService;
import serviceimpl.ShowStoryServiceIpmt;
@WebServlet("/showStoryServlet")
public class showStoryServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ShowStoryService showStory = new ShowStoryServiceIpmt();
		List<Story> list = showStory.showStory();
		request.setAttribute("list", list);
		request.getSession().setAttribute("story", list);
		request.getRequestDispatcher("/story/Pl_story.baihe.com_1/story.jsp").forward(request, response);
	}
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}
}
